#include "Logging.h"

namespace ComputingObjects {

Logger::Logger(std::string prefix, enum logLevel level)
	: myPrefix(prefix), myLevel(level), myErrorStream(&std::cout),
	myWarnStream(&std::cout), myInfoStream(&std::cout), myDebugStream(&std::cout)
	{};

Logger::~Logger() {};


std::ostream& Logger::operator<<(const char* data)
{
	std::ostream* stream(NULL);
	switch (myLevel) {
	case ERROR:
		stream = myErrorStream;
	case WARN:
		stream = myWarnStream;
	case INFO:
		stream = myInfoStream;
	case DEBUG:
		stream = myDebugStream;
	}
	return (*stream)<<data;

}

std::ostream& Logger::operator <<(enum logLevel level)
{
	switch (level) {
	case ERROR:
		return *myErrorStream;
	case WARN:
		return *myWarnStream;
	case INFO:
		return *myInfoStream;
	case DEBUG:
		return *myDebugStream;
	}
	return *myErrorStream;
}

}